package com.longdaji.decoration.data.network;

import com.longdaji.decoration.bean.Account;
import com.longdaji.decoration.bean.Balance;
import com.longdaji.decoration.bean.Collection;
import com.longdaji.decoration.bean.CommonResult;
import com.longdaji.decoration.bean.Feedback;
import com.longdaji.decoration.bean.GoodsComment;
import com.longdaji.decoration.bean.MyCities;
import com.longdaji.decoration.bean.MyLogistics;
import com.longdaji.decoration.bean.MyProvinces;
import com.longdaji.decoration.bean.MyUniversities;
import com.longdaji.decoration.bean.OperationResult;
import com.longdaji.decoration.bean.Order;
import com.longdaji.decoration.bean.Orders;
import com.longdaji.decoration.bean.ReceivingAddress;
import com.longdaji.decoration.bean.RefundGoods;
import com.longdaji.decoration.data.bean.AdBean;
import com.longdaji.decoration.data.bean.AddressBean;
import com.longdaji.decoration.data.bean.AssessUrlBean;
import com.longdaji.decoration.data.bean.AvailableMoneyBean;
import com.longdaji.decoration.data.bean.AvailableScoreBean;
import com.longdaji.decoration.data.bean.CaptainCheckBean;
import com.longdaji.decoration.data.bean.CaptainInfoBean;
import com.longdaji.decoration.data.bean.CartBean;
import com.longdaji.decoration.data.bean.GoodsAccountBean;
import com.longdaji.decoration.data.bean.GoodsBean;
import com.longdaji.decoration.data.bean.GoodsCategory;
import com.longdaji.decoration.data.bean.GoodsChosensBean;
import com.longdaji.decoration.data.bean.GoodsCommentBean;
import com.longdaji.decoration.data.bean.GoodsCommentListBean;
import com.longdaji.decoration.data.bean.GoodsDetailImageBean;
import com.longdaji.decoration.data.bean.GoodsImagesBean;
import com.longdaji.decoration.data.bean.GoodsMotifsBean;
import com.longdaji.decoration.data.bean.GoodsSkuBean;
import com.longdaji.decoration.data.bean.InviteCodeBean;
import com.longdaji.decoration.data.bean.LogisticsBean;
import com.longdaji.decoration.data.bean.OrderBean;
import com.longdaji.decoration.data.bean.PakageBean;
import com.longdaji.decoration.data.bean.PayBean;
import com.longdaji.decoration.data.bean.ShareUrlBean;
import com.longdaji.decoration.data.bean.SignInBean;
import com.longdaji.decoration.data.bean.SignInDataBean;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Flowable;
import okhttp3.RequestBody;

/**
 * Created by longtao on 2018/1/4.
 */

public class HttpHelperImp implements HttpHelper {
    private ApiService mApiService;

    @Override
    public Flowable<HttpResponse> doRegisterApi(String username, String name, String telephone, String password, String remark, String sign, String constellation, String genger, String head_img_location, String registerTime, String campusName, String dormitoryName, int isGraduate) {
        return mApiService.doRegisterApi(username, name, telephone, password, remark, sign, constellation, genger, head_img_location, registerTime, campusName, dormitoryName, isGraduate);
    }

    @Inject
    public HttpHelperImp(ApiService apiService) {
        this.mApiService = apiService;
    }

    @Override
    public Flowable<HttpResponse<GoodsCategory>> getGoodsCatergory() {
        return mApiService.getGoodsCatergory();
    }

    @Override
    public Flowable<HttpResponse<GoodsBean>> getGoodsList(String cateId, String orderBy, String userId) {
        return mApiService.getGoodsList(cateId, orderBy, userId);
    }

    @Override
    public Flowable<HttpResponse<GoodsImagesBean>> getGoodsImages(String goodId) {
        return mApiService.getGoodsImages(goodId);
    }

    @Override
    public Flowable<HttpResponse<CartBean>> getCartList(String userId) {
        return mApiService.getCartList(userId);
    }

    @Override
    public Flowable<HttpResponse<GoodsSkuBean>> getGoodsDetail(String goodId, String userId) {
        return mApiService.getGoodsDetail(goodId, userId);
    }

    @Override
    public Flowable<HttpResponse> deleteFromChart(String userId, String[] idList) {
        return mApiService.deleteFromChart(userId, idList);
    }

    @Override
    public Flowable<HttpResponse<GoodsAccountBean>> accountFromChart(String userId, List<String> idList) {
        return mApiService.accountFromChart(userId, idList);
    }

    @Override
    public Flowable<HttpResponse> collectGoodsList(String userId, List<String> idList) {
        return mApiService.collectGoodsList(userId, idList);
    }

    public Flowable<HttpResponse> doUsernameVerifyApi(String username, String telephone) {
        return mApiService.doUsernameVerifyApi(username, telephone);
    }

    @Override
    public Flowable<HttpResponse> doTelephoneVerifyApi(String username, String telephone) {
        return mApiService.doTelephoneVerifyApi(username, telephone);
    }

    @Override
    public Flowable<HttpResponse<Account>> doPasswordLoginApi(String username, String password, String loginTime) {
        return mApiService.doPasswordLoginApi(username, password, loginTime);
    }

    @Override
    public Flowable<HttpResponse> doVerificationRequest(String telephone, String code) {
        return mApiService.doVerificationRequest(telephone, code);
    }

    @Override
    public Flowable<HttpResponse> doVerificationResult(String telephone, String code) {
        return mApiService.doVerificationResult(telephone, code);
    }

    @Override
    public Flowable<HttpResponse> getCaptainInfo(String dormitoryId, String dormitoryName) {
        return mApiService.getCaptainInfo(dormitoryId, dormitoryName);
    }

    @Override
    public Flowable<HttpResponse> modifyCartItemNum(Map<String, String> options) {
        return mApiService.modifyCartItemNum(options);
    }

    @Override
    public Flowable<HttpResponse<GoodsCommentListBean>> getGoodsComments(String goodsId, String userId) {
        return mApiService.getGoodsComments(goodsId, userId);
    }

    @Override
    public Flowable<HttpResponse> addGoodsSkuToCart(Map<String, Object> options) {
        return mApiService.addGoodsSkuToCart(options);
    }

    @Override
    public Flowable<HttpResponse<AddressBean.Address>> getDefaultAddress(String userid) {
        return mApiService.getDefaultAddress(userid);
    }

    @Override
    public Flowable<HttpResponse<AddressBean>> getAddressList(String userid) {
        return mApiService.getAddressList(userid);
    }

    @Override
    public Flowable<HttpResponse<PayBean>> getPayOrderInfo(Map<String, Object> options) {
        return mApiService.getPayOrderInfo(options);
    }

    public Flowable<HttpResponse> doForgetPasswordApi(String telephone, String password) {
        return mApiService.doForgetPasswordApi(telephone, password);
    }

    @Override
    public Flowable<HttpResponse<MyProvinces>> doGetProvince() {
        return mApiService.doGetProvince();
    }

    @Override
    public Flowable<HttpResponse<MyCities>> doGetCity() {
        return mApiService.doGetCity();
    }

    @Override
    public Flowable<HttpResponse<MyUniversities>> doGetCampus() {
        return mApiService.doGetCampus();
    }


    @Override
    public Flowable<HttpResponse> doUpdatePersonalInfoApi(String userid, String username, String name, String remark, String sign, String constellation, String gender, String head_img_location, int credits) {
        return mApiService.doUpdatePersonalInfoApi(userid, username, name, remark, sign, constellation, gender, head_img_location, credits);
    }

    @Override
    public Flowable<HttpResponse> doUpdateAccountApi(String userid, String username, String telephone, String password) {
        return mApiService.doUpdateAccountApi(userid, username, telephone, password);
    }

    @Override
    public Flowable<HttpResponse> doUpdateCampusApi(String userid, String campusName, String dormitoryName) {
        return mApiService.doUpdateCampusApi(userid, campusName, dormitoryName);
    }

    @Override
    public Flowable<HttpResponse<Account>> doGetUserInfoApi(String userid, String userName) {
        return mApiService.doGetUserInfoApi(userid, userName);
    }

    @Override
    public Flowable<HttpResponse> doAddReceivingAddressApi(String userid, String contactPerson, String contactTelephone, String province, String city, String district, String street, String detailAddress, String createTime, String defaultAddress, String zipcode, String delFlag) {
        return mApiService.doAddReceivingAddressApi(userid, contactPerson, contactTelephone, province, city, district, street, detailAddress, createTime, defaultAddress, zipcode, delFlag);
    }

    @Override
    public Flowable<HttpResponse<ReceivingAddress>> doGetReceivingAddressApi(String userid, String userName) {
        return mApiService.doGetReceivingAddressApi(userid, userName);
    }

    @Override
    public Flowable<HttpResponse> doDeleteReceivingAddressApi(String userid, int shippingId) {
        return mApiService.doDeleteReceivingAddressApi(userid, shippingId);
    }

    @Override
    public Flowable<HttpResponse> doUpdateReceivingAddressApi(String userid, String contactPerson, String contactTelephone, String province, String city, String district, String street, String detailAddress, String createTime, String defaultAddress, int shippingId, String zipcode, String delFlag) {
        return mApiService.doUpdateReceivingAddressApi(userid, contactPerson, contactTelephone, province, city, district, street, detailAddress, createTime, defaultAddress, shippingId, zipcode, delFlag);
    }

    @Override
    public Flowable<HttpResponse<ReceivingAddress>> doGetDefaultReceivingAddressApi(String userid, String userName) {
        return mApiService.doGetDefaultReceivingAddressApi(userid, userName);
    }

    @Override
    public Flowable<HttpResponse<Orders>> doGetOrderApi(String userid, String status, String orderNo) {
        return mApiService.doGetOrderApi(userid, status, orderNo);
    }

    @Override
    public Flowable<HttpResponse> doGenerateOrderApi(Order order) {
        return mApiService.doGenerateOrderApi(order);
    }

    @Override
    public Flowable<HttpResponse<OperationResult>> doCancelOrderApi(String userid, String orderNo) {
        return mApiService.doCancelOrderApi(userid, orderNo);
    }

    @Override
    public Flowable<HttpResponse<CommonResult>> doRefundApi(String userid, String userName) {
        return mApiService.doRefundApi(userid, userName);
    }

    @Override
    public Flowable<HttpResponse<CommonResult>> doExchangeApi(String userid, String userName) {
        return mApiService.doExchangeApi(userid, userName);
    }

    @Override
    public Flowable<HttpResponse> doGetUpTokenApi() {
        return mApiService.doGetUpTokenApi();
    }

    @Override
    public Flowable<HttpResponse<Collection>> doGetCollectionApi(String userid) {
        return mApiService.doGetCollectionApi(userid);
    }

    @Override
    public Flowable<HttpResponse> doDeleteCollectionApi(String idList, String userId) {
        return mApiService.doDeleteCollectionApi(idList, userId);
    }

    @Override
    public Flowable<HttpResponse> doReturnGoodsApi(String userid, String orderNum, int skuId, int skuNum, long captainId, double refundMoney, String refundReason, String refundDesc, String delFlag) {
        return mApiService.doReturnGoodsApi(userid, orderNum, skuId, skuNum, captainId, refundMoney, refundReason, refundDesc, delFlag);
    }

    public Flowable<HttpResponse<GoodsDetailImageBean>> getGoodsDetailImage(String goodId) {
        return mApiService.getGoodsDetailImage(goodId);
    }

    @Override
    public Flowable<HttpResponse<GoodsMotifsBean>> getTopicImage() {
        return mApiService.getTopicImage();
    }

    @Override
    public Flowable<HttpResponse<GoodsChosensBean>> getChosenImage() {
        return mApiService.getChosenImage();
    }

    @Override
    public Flowable<HttpResponse> likeGoodsOrNot(String userId, String commentsId, String isLike) {
        return mApiService.likeGoodsOrNot(userId, commentsId, isLike);
    }

    @Override
    public Flowable<HttpResponse> disCollectGoodsList(String userId, List<String> idList) {
        return mApiService.disCollectGoodsList(userId, idList);
    }

    @Override
    public Flowable<HttpResponse> doGoodsCommentApi(GoodsComment goodsComment) {
        return mApiService.doGoodsCommentApi(goodsComment);
    }

    @Override
    public Flowable<HttpResponse<MyLogistics>> doSeeLogisticsApi(String orderNo) {
        return mApiService.doSeeLogisticsApi(orderNo);
    }

//    @Override
//    public Flowable<HttpResponse<OrderRefund>> doGetRefundOrderApi(String userid) {
//        return mApiService.doGetRefundOrderApi(userid);
//    }

    @Override
    public Flowable<HttpResponse> doFeedbackApi(String userId, String connection, String viewContent) {
        return mApiService.doFeedbackApi(userId, connection, viewContent);
    }

    @Override
    public Flowable<HttpResponse<Feedback>> doGetFeedbackApi(String userId) {
        return mApiService.doGetFeedbackApi(userId);
    }

    public Flowable<HttpResponse<SignInBean>> signIn(String userId) {
        return mApiService.signIn(userId);
    }

    @Override
    public Flowable<HttpResponse<SignInDataBean>> getSignInData(String userId) {
        return mApiService.getSignInData(userId);
    }

    @Override
    public Flowable<HttpResponse<OrderBean>> creatOrder(RequestBody requestBody) {
        return mApiService.creatOrder(requestBody);
    }

    @Override
    public Flowable<AssessUrlBean> getAssessTypeUrl(String userId, int authType) {
        return mApiService.getAssessTypeUrl(userId, authType);
    }

    @Override
    public Flowable<HttpResponse> verifyCreditScore(String certNo, String name) {
        return mApiService.verifyCreditScore(certNo, name);
    }

    @Override
    public Flowable<HttpResponse> applyCaptain(String userId, String captainName, String dormitoryId, String telephone) {
        return mApiService.applyCaptain(userId, captainName, dormitoryId, telephone);
    }

    @Override
    public Flowable<HttpResponse> setDefaultAddr(String userid, String defaultAddress, long shippingId) {
        return mApiService.setDefaultAddr(userid, defaultAddress, shippingId);
    }

    @Override
    public Flowable<HttpResponse<GoodsCommentBean>> getDefaultComment(String goodsId) {
        return mApiService.getDefaultComment(goodsId);
    }

    @Override
    public Flowable<HttpResponse<List<PakageBean>>> getPakagePattern() {
        return mApiService.getPakagePattern();
    }

    @Override
    public Flowable<HttpResponse<List<LogisticsBean>>> getLogisticsPattern() {
        return mApiService.getLogisticsPattern();
    }

    @Override
    public Flowable<HttpResponse<AvailableScoreBean>> getAvailableScore(String userId) {
        return mApiService.getAvailableScore(userId);
    }

    @Override
    public Flowable<HttpResponse<AvailableMoneyBean>> getAvailableMoney(String userId) {
        return mApiService.getAvailableMoney(userId);
    }

    @Override
    public Flowable<HttpResponse<CaptainCheckBean>> getCaptainApplyStatus(String userId) {
        return mApiService.getCaptainApplyStatus(userId);
    }

    @Override

    public Flowable<HttpResponse<ShareUrlBean>> getShareUrl() {
        return mApiService.getShareUrl();
    }

    @Override
    public Flowable<HttpResponse<InviteCodeBean>> verifyInviteCode(String inviteCode) {
        return mApiService.verifyInviteCode(inviteCode);
    }

    @Override
    public Flowable<HttpResponse> countVisitNum(String goodsId, String cateId, String userId, String visitTime) {
        return mApiService.countVisitNum(goodsId, cateId, userId, visitTime);
    }


    public Flowable<HttpResponse> doReceivingGoodsApi(String userid, String orderNo) {
        return mApiService.doReceivingGoodsApi(userid, orderNo);
    }

    @Override
    public Flowable<HttpResponse<Balance>> doGetBalanceDetailApi(String userId, int type, int pageNo, int pageSize) {
        return mApiService.doGetBalanceDetailApi(userId, type, pageNo, pageSize);
    }

    @Override
    public Flowable<HttpResponse<List<RefundGoods>>> doGetRefundGoodsApi(String userid) {
        return mApiService.doGetRefundGoodsApi(userid);
    }

    @Override
    public Flowable<HttpResponse<List<CaptainInfoBean>>> queryCaptainInfo(String userId) {
        return mApiService.queryCaptainInfo(userId);
    }

    @Override
    public Flowable<HttpResponse<AdBean>> getAd() {
        return mApiService.getAd();
    }

}
